<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib uri="/WEB-INF/tld/struts-bean" prefix="bean"%> 
<%@ taglib uri="/WEB-INF/tld/struts-html" prefix="html"%>
<%@ taglib uri="/WEB-INF/tld/struts-logic" prefix="logic" %>
<%@ taglib uri="/WEB-INF/tld/jstl/c" prefix="c" %>
<%@ taglib uri="/WEB-INF/tld/jstl/fmt" prefix="fmt" %>
<%@ taglib uri="/WEB-INF/tld/jstl/fn" prefix="fn" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta http-equiv="pragma" content="no-cache">
<meta http-equiv="cache-control" content="no-cache">
<meta http-equiv="expires" content="0">
<meta http-equiv="keywords" content="ebb365,ebb365,ebb365">
<meta http-equiv="description" content="ebb365">
<title>Insert title here</title>
<link rel="stylesheet" type="text/css" href="/admin/css/css.css">
<script>
function checkForm(){
 
  if(document.forms[0].titleName.value==''){
      alert('标题必须填写');
      return false;
  }else if(document.forms[0].linkUrl.value==''){
      alert('连接地址必须填写');
      return false;
  }else if(document.forms[0].catalogid.value==-1){
      alert('分类必须选择');
      return false;
  }else{    
      return true;
  }

}
</script>
</head>
<body>
<logic:present name="wellDo">
<bean:write name="wellDo" filter="false"></bean:write>
</logic:present>
<html:form action="/admin/PageCommendAction.do?method=saveOrUpdate" onsubmit="return checkForm();" enctype="multipart/form-data">
<table width="700" align="center" >
<html:hidden property="commendId" value="${pagecommend.commendId}"></html:hidden>
 <input type="hidden" name="catalogidstr" value="${catalogid}"/>
 <input type="hidden" name="picstr" value="${pagecommend.imgUrl}"/>
<tr><td>标题：</td><td><html:text property="titleName" value="${pagecommend.titleName}"></html:text><font color=red>*</font></td></tr>
<tr><td>简短介绍：</td><td><html:textarea property="info" rows="5" cols="30" value="${pagecommend.info}"></html:textarea></td></tr>
<tr><td>连接地址：</td><td><html:text property="linkUrl" value="${pagecommend.linkUrl}"></html:text><font color=red>*</font>http://www.qqddc.com/</td></tr>
<tr><td>图片地址：</td><td>
 <input type="file" name="pic" />
<c:if test="${pagecommend.imgUrl!=null}">
    <html:link href="/fileUpload/shop/${pagecommend.imgUrl}" target="_blank"><font color=green>图片已存在，查看图片</font></html:link>
</c:if>
</td></tr>
<tr><td>标题别名：</td><td><html:text property="aliases" value="${pagecommend.aliases}"></html:text> </td></tr>
<tr><td>所属分类：</td><td>
<html:select property="catalogid" size="1">
<html:option value="-1">请选择分类</html:option>
<logic:present name="optionStr">
<bean:write name="optionStr" filter="false"></bean:write>
</logic:present>
</html:select>
 </td></tr>
<tr><td>排列顺序：</td><td><html:text property="taxis" value="${pagecommend.taxis}"></html:text> </td></tr>
<tr><td>备用段一：</td><td><html:text property="commonOne" value="${pagecommend.commonOne}"></html:text> </td></tr>
<tr><td>备用段二：</td><td><html:text property="commonTwo" value="${pagecommend.commonTwo}"></html:text> </td></tr>
<tr><td>备用段三：</td><td><html:text property="commonThree" value="${pagecommend.commonThree}"></html:text> </td></tr>
<tr><td>备用段四：</td><td><html:text property="commonFour" value="${pagecommend.commonFour}"></html:text></td></tr>
<tr><td>备用段五：</td><td><html:text property="commonFive" value="${pagecommend.commonFive}"></html:text></td></tr>
<tr><td><html:submit>提交</html:submit> </td><td><html:reset>重置</html:reset> </td></tr>
</table>
</html:form>
</body>
</html>